﻿@model PetaPoco.Page<ZhongheCms.Models.GswTblMember>
@{
	Layout = "~/Views/Shared/_Layout.cshtml";
    string mysel = "";
    string myfcss = "";
    string mylcss = "";
    string mycss = "";
    if (Model.CurrentPage == 1)
    {
        myfcss = "disabled";
    }
    var fp = Model.CurrentPage - 1;
    if (ViewBag.pageIndex == Model.TotalPages)
    {
        mylcss = "disabled";
    }
    var np = Model.CurrentPage + 1;
}
@section css{
	<link rel="stylesheet" href="/Assets/css/datepicker.css" />
}
<div class="row">
	<div class="col-xs-12 padding-0">
		<div class="widget-box">
			<div class=" widget-header widget-header-flat" style="padding-left: 0px">
				
				<div class="widget-toolbar">
					<form name="thisform" method="post" class="form-search" action="/MemberInfo/Index/0?m=@ViewBag.m&f=@ViewBag.f&p=@ViewBag.p&fid=@ViewBag.fid">
						<label>
							<input class="date-picker search-input" id="sdate" name="sdate" type="text" data-date-format="yyyy-mm-dd" value="@ViewBag.sdate" placeholder="开始日期" style="width: 120px"/>
																	<i class="fa fa-exchange"></i>
																<input class="date-picker search-input" id="edate" name="edate" type="text" data-date-format="yyyy-mm-dd" value="@ViewBag.edate" placeholder="结束日期" style="width: 120px"/>
							<input type="text" name="keywords" id="keywords" placeholder="关键词" value="@ViewBag.keywords" class="search-input"  autocomplete="off">
						</label>
						
															
						<label>
							<button type="submit" class="btn btn-xs btn-toolbar pull-right">
								&nbsp;&nbsp; <i class="fa fa-search"></i><span class="bigger-110">搜索</span> &nbsp;&nbsp;
							</button>
						</label>
					</form>
				</div>

			</div>
			<div class="widget-body">
				<div class="widget-main padding-2">

					<table class="table table-striped table-bordered table-hover">
						<tr>
							<th class="center">管理
							</th>
						   <th>注册日期
							</th>
							<th>会员类别</th>
							<th>所在学校</th>
							<th>入学年份</th>
							<th>真实姓名</th>
							@*<th>昵称</th>*@
							<th>性别</th>
							<th>联系电话</th>
							<th>电子邮件</th>
							<th>状态</th>
							<th class="center">删除
							</th>
						</tr>
						<tbody>
							@foreach (var item in Model.Items)
							{
								
								<tr>
									<td class="center">
								   
										<a href="/MemberInfo/MemberView/@item.Id?m=@ViewBag.m&f=@ViewBag.f&p=@ViewBag.p&fid=@ViewBag.fid&sdate=@ViewBag.sdate&edate=@ViewBag.edate&keywords=@ViewBag.keywords&pageIndex=@Model.CurrentPage"><span class="btn btn-xs btn-info no-border">
																																																	 <i class="fa fa-check-square-o"></i></span></a>
									
										
									</td>
								  


									<td>
										@item.RegDate.ToShortDateString() 
									</td>
									<td>
										@item.MemberType
									</td>
									<td>
										@item.SchoolName
									   
									</td>
									<td>
										@item.EnterSchoolYear
									</td>
									 <td>
										@item.MemberName
									</td>
									@*<td>
										@item.MemberNickname
									</td>*@
									<td>
										@item.Gender
									</td>
									<td>
										@item.MemberTel
									</td>
									<td>
										@item.MemberEmail
									</td>
									<td>
									  @if (item.AuditFlag == 0)
									  {
										  <span>未审核</span>
									  }
									  @if (item.AuditFlag == 1)
									  {
										  <span>已核准</span>
									  }
									 @if (item.AuditFlag == 2)
									  {
										  <span>已停止</span>
									  }
									 

									</td>
								   
									<td class="center">
										 
									
                                        <a class="confirm" href="/MemberInfo/Delete/@item.Id?m=@ViewBag.m&f=@ViewBag.f&p=@ViewBag.p&fid=@ViewBag.fid&sdate=@ViewBag.sdate&edate=@ViewBag.edate&keywords=@ViewBag.keywords&pageIndex=@Model.CurrentPage">
                                            <span class="btn btn-xs btn-danger no-border"><i class="fa fa-trash-o"></i></span>
                                        </a>
									
									   
									</td>
								</tr>
									   
							}
						</tbody>
					</table>

			    </div>
                @if (Model.TotalPages > 1)
                {
                    <div class="modal-footer no-margin-top">
                        <button class="btn btn-sm btn-danger pull-left" data-dismiss="modal">
                            共 @Model.TotalItems 条记录
                        </button>

                        <ul class="pagination pull-right no-margin">
                            <li class="prev @myfcss">
                                <a href="/MemberInfo/Index/0?m=@ViewBag.m&f=@ViewBag.f&p=@ViewBag.p&fid=@ViewBag.fid&sdate=@ViewBag.sdate&edate=@ViewBag.edate&jname=@ViewBag.jname&pageIndex=@fp">
                                    <i class="fa fa-angle-double-left"></i>
                                </a>
                            </li>
                            @for (int i = 1; i <= Model.TotalPages; i++)
                            {
                                mycss = "";
                                if (i == ViewBag.pageIndex)
                                {
                                    mycss = "active";
                                }
                                <li class="@mycss"><a href="/MemberInfo/Index/0?m=@ViewBag.m&f=@ViewBag.f&p=@ViewBag.p&fid=@ViewBag.fid&sdate=@ViewBag.sdate&edate=@ViewBag.edate&jname=@ViewBag.jname&pageIndex=@i">@i</a></li>


                            }



                            <li class="next @mylcss">
                                <a href="/MemberInfo/Index/0?m=@ViewBag.m&f=@ViewBag.f&p=@ViewBag.p&fid=@ViewBag.fid&sdate=@ViewBag.sdate&edate=@ViewBag.edate&jname=@ViewBag.jname&pageIndex=@np">
                                    <i class="fa fa-angle-double-right"></i>
                                </a>
                            </li>
                        </ul>
                    </div>
                }
			</div>
		</div>
	</div>
</div>
@section js
{
	 
	<script src="/assets/js/date-time/bootstrap-datepicker.min.js"></script>
	<script src="/assets/js/date-time/bootstrap-datepicker.zh-CN.js" ></script>
	<script src="/assets/js/bootbox.min.js"></script>
	<script type="text/javascript">
		jQuery(function ($) {
			//$('.datepick').datepicker({ autoclose: true, format: "yyyy-mm-dd", language: "zh-CN" });
			$('.date-picker').datepicker({
				autoclose: true,
				todayHighlight: true,
				language: "zh-CN"
			});
			bootbox.setDefaults({ locale: "zh_CN" });
			$(".confirm").on(ace.click_event, function (e) {
				e.preventDefault();
				var link = $(this).attr("href");
				bootbox.confirm("确认删除此记录吗?", function (result) {
					if (result) {
						document.location.href = link;
					}
				});
			});

		});
	</script>

}
